package homework022;

/**
 * 描述
 *
 * @author : tdl
 * @date : 2021/9/4 10:37 AM
 **/
public enum AttrEnums {
    /**
     *
     */
    ATTR1("attr1", "分辨率"),
    ATTR2("attr2", "类型"),
    ATTR3("attr3", "系统"),
    ATTR4("attr4", "厚度");

    private String en;
    private String ch;

    AttrEnums(String en, String ch) {
        this.en = en;
        this.ch = ch;
    }

    public String getCh() {
        return ch;
    }

    public String getEn() {
        return en;
    }

    public static String getByEn(String en) {
        AttrEnums[] values = AttrEnums.values();
        for (AttrEnums value : values) {
            if (value.getEn().equals(en)) {
                return value.getCh();
            }
        }

        return "";
    }

}
